﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Bando : System.Web.UI.Page
{


    public String Load_Map()
    {

        //trong code nay ban su dung ket noi cSDL roi thay doi gia tri nay lại la duoc
        //ban hieu chu
        // de e suy nghi chu chua hiu lam
        //tai 2 diem nay trung nhau nen no hien thi la 1
        // ban sua lai csdl la ok
        // cac chuc nang them, xoa , sua lam nhu e dung k a
        // ban chay len minh choi thu
        string makhuvuc = Request.QueryString["makhuvuc"];
        if (makhuvuc != null)
            makhuvuc = " and makhuvuc = " + makhuvuc;

        Dataprovider pr = new Dataprovider();
       DataSet ds = pr.get("select  * from [ThongTinATM] where IsActive = 1 " + makhuvuc);
        string strToaDo = "[";
        if (ds != null && ds.Tables.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                strToaDo += "[" + ds.Tables[0].Rows[i]["Latitude"] + "," + ds.Tables[0].Rows[i]["Longtitude"] + ",'" + ds.Tables[0].Rows[i]["TenmayATM"] + "','" + ds.Tables[0].Rows[i]["Diachi"] + "'," + ds.Tables[0].Rows[i]["MaATM"] + "],";
            }
        }
        strToaDo = strToaDo.TrimEnd(',');
        strToaDo += "]";

        return strToaDo;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }
}